package homework;

public class Homework13 {
	public static void main(String[] args) {
		//1+2-3+4-5+6-7....+100的结果(单层循环)
		
		int sum = 1;
		for (int i = 2 ; i <= 100; i++) {
			if (i % 2 == 0) {
				sum += i;
			}else {
				sum += -i;
			}
		}
		System.out.println(sum);
	}
}
